<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
	xmlns:f="http://xmlns.jcp.org/jsf/core"
	xmlns:h="http://xmlns.jcp.org/jsf/html"
	xmlns:p="http://primefaces.org/ui"
    xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
	template="/WEB-INF/templates/public/default.xhtml"
>

	<f:metadata>
		<f:viewParam name="firstResult" value="#{serviceSupplierList.firstResult}"></f:viewParam>
		<f:viewParam name="cnname" value="#{serviceSupplierList.cnname}"></f:viewParam>		
		<f:viewParam name="qClassName" value="#{serviceSupplierList.parameterValues['qClassName']}"></f:viewParam>
		<f:viewParam name="qClassId" value="#{qualificationConditionBean.qualificationClassId}"></f:viewParam>
		<f:viewParam name="agentServiceId" value="#{qualificationConditionBean.agentServiceId}"></f:viewParam>
		<f:viewParam name="sectorId" value="#{qualificationConditionBean.sectorId}"></f:viewParam>
		<f:viewParam name="childSectorSno" value="#{qualificationConditionBean.childSectorSno}"></f:viewParam>
		<f:viewParam name="certLevel" value="#{qualificationConditionBean.certLevel}"></f:viewParam>
		<f:viewParam name="region" value="#{serviceSupplierList.parameterValues['region']}"></f:viewParam>
		
	</f:metadata>

	<ui:define name="head">
		<h:outputStylesheet name="css/public/zhongjieminglu.css" />
		<style type="text/css">
		</style>
	</ui:define>

	<ui:define name="content">
		<h:form>
		<p:messages />
		
		<div class="sub_wrap">
			<div class="Methbox_tit">
				<h2>中介名录</h2>
			</div>

			<!--从这儿引用zhongjieminglu.css-->
			<div class="zjname-list">
				<h:panelGrid columns="2">
					<p:outputLabel value="中介名称："></p:outputLabel>
					<p:inputText value="#{serviceSupplierList.cnname}" style="width: 500px;"></p:inputText>
					
					<p:outputLabel value="服务事项："></p:outputLabel>
					<p:selectOneMenu value="#{qualificationConditionBean.agentServiceId}" filter="true">
						<f:selectItem
									itemLabel="--请选择--"
									itemValue="#{null}"
								/>
								<f:selectItems
									value="#{agentServiceList.resultList}"
									var="_agentService"
									itemLabel="#{_agentService.name}"
									itemValue="#{_agentService.id}"
								></f:selectItems>
					</p:selectOneMenu>	
					
					<p:outputLabel value="资质范围："></p:outputLabel>
					<p:outputPanel>
						<p:selectOneMenu
							value="#{qualificationConditionBean.qualificationClassId}"
						>
							<f:selectItem
								itemLabel="--请选择--"
								itemValue="#{null}"
							/>
							<f:selectItems
								value="#{qualificationClassList.resultList}"
								var="_class"
								itemLabel="#{_class.name}"
								itemValue="#{_class.id}"
							>
							</f:selectItems>
							<f:ajax render="sectorId certLevel"></f:ajax>
						</p:selectOneMenu>#{' '}	
										
						<p:selectOneMenu
							id="sectorId"
							widgetVar="sectorId"
							value="#{qualificationConditionBean.sectorId}"
						>
							<f:selectItem
								itemLabel="--请选择--"
								itemValue="#{null}"
							/>
							<f:selectItems
								value="#{qualificationConditionBean.sectors}"
								var="_sector"
								itemLabel="#{_sector.sectorName}"
								itemValue="#{_sector.id}"
							></f:selectItems>
							<f:ajax event="change" listener="#{qualificationConditionBean.initChildSectors()}" render="childSectorId"></f:ajax>
						</p:selectOneMenu>
						
						<p:selectOneMenu
							id="childSectorId"
							widgetVar="childSectorId"
							value="#{qualificationConditionBean.childSectorSno}"
						>
							<f:selectItem
								itemLabel="--请选择--"
								itemValue="#{null}"
							/>
							<f:selectItems
								value="#{qualificationConditionBean.childSectors}"
								var="_childsector"
								itemLabel="#{_childsector.sectorName}"
								itemValue="#{_childsector.sno}"
							></f:selectItems>
							
						</p:selectOneMenu>

					</p:outputPanel>
					<p:outputLabel value="资质等级："></p:outputLabel>
					<p:selectOneMenu
						id="certLevel"
						value="#{qualificationConditionBean.certLevel}"
					>
						<f:selectItem
							itemLabel="--请选择--"
							itemValue="#{null}"
						/>
						
						<f:selectItems
							value="#{qualificationConditionBean.qualificationLevels}"
							var="_level"
							itemLabel="#{_level.name}"
							itemValue="#{_level.value}"
						></f:selectItems>						
					</p:selectOneMenu>

					<p:outputLabel value="机构所在地："></p:outputLabel>
					<p:selectOneMenu value="#{serviceSupplierList.parameterValues['region']}">
						<f:selectItem itemLabel="--请选择--" itemValue="#{null}"/>
						<f:selectItem itemLabel="东营市" itemValue="东营市" />
						<f:selectItem itemLabel="其他地区" itemValue="其他地区" />
					</p:selectOneMenu>
				</h:panelGrid>
				<div class="actionButtons">
					<p:commandButton value="查询" ajax="false" action="SupplierList.xhtml?faces-redirect=true&amp;includeViewParams=true&amp;firstResult=0" >
						<f:param name="qClassName" value=""></f:param>
					</p:commandButton>
				</div>			
			</div>
			<div class="clearbt"></div>
			
			<p:repeat var="_supplier" value="#{serviceSupplierList.resultList}">
				<div class="zjnlt-box fleft">
					<div class="zjnlt-h fleft">
						<c:if test="#{param.debug}">
							<h2>
								<h:outputText value="#{_supplier.randomScore}" >
									<f:convertNumber maxFractionDigits="1" minFractionDigits="1"/>
								</h:outputText>
							</h2>
							<h5>评价<h:outputText value="#{_supplier.randomOrderCount}" />次</h5>
						</c:if>
						<c:if test="#{empty param.debug or not param.debug}">
							<h2>
								<h:outputText value="#{_supplier.creditLevel.typeName}" rendered="#{not empty _supplier.score}" >
									
								</h:outputText>
								<h:outputText value="无" rendered="#{empty _supplier.score}" />
							</h2>
							<h5>评价<h:outputText value="#{_supplier.orderCount}" />次</h5>
						</c:if>
					</div>
					<ul class="zjnlt fleft">
						<li>
							<p:link outcome="SupplierView.xhtml" target="_blank">
								<h5><h:outputText value="#{_supplier.cnname}" /></h5>
								<f:param name="serviceSupplierId" value="#{_supplier.id}"></f:param>
							</p:link>							
						</li>
						<li>
							注册资金：
							<h:outputText value="#{_supplier.registeredFund}">
								<f:convertNumber maxFractionDigits="2" groupingUsed="false"/>
							</h:outputText>
							万元
						</li>
						<li>联系人：<h:outputText value="#{_supplier.firstContactor}" /></li>
						<li>联系电话：<h:outputText value="#{_supplier.firstContactorPhoneNumber}" /></li>
						<li>办公地址：<h:outputText value="#{_supplier.address}" /></li>
					</ul>
					<div class="clearbt"></div>
				</div>
			</p:repeat>
		</div>
			
		<ui:include src="/WEB-INF/templates/manage/pagination.xhtml">
			<ui:param name="entityList" value="#{serviceSupplierList}" />
		</ui:include>
		</h:form>
	</ui:define>

</ui:composition>